@charset "UTF-8";
@use 'sass:math';

@import './variables.scss';

/* HTML elements */
*,
:after,
:before {
  box-sizing: border-box;
}

html {
  line-height: $line-height-normal;
  font-size: $font-size-root;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: $font-body;
  font-size: $font-size-1;
  color: $color-text;
  text-rendering: optimizeLegibility;
}

footer {
  padding: $spacing-6 $spacing-0;
}

hr {
  background: $color-accent;
  height: 1px;
  border: 0;
}

/* Heading */
h1,
h2,
h3,
h4,
h5,
h6 {
  // check imported weights and styles in gatsby-browser.jsx
  font-family: $font-heading;
  margin: $spacing-12 0 $spacing-6;
  line-height: $line-height-tight;
}

h3,
h4,
h5,
h6 {
  font-weight: $font-weight-bold;
  color: $color-heading;
}

h1 {
  margin-top: 0;
  font-weight: $font-weight-black;
  font-size: $font-size-6;
  font-style: italic;
  color: $color-heading-black;
}

h2 {
  font-size: $font-size-5;
  font-weight: $font-weight-semibold;
  color: $color-heading;
}

h3 {
  font-size: $font-size-4;
}

h4 {
  font-size: $font-size-3;
}

h5 {
  font-size: $font-size-2;
}

h6 {
  font-size: $font-size-1;
}

/* Prose */
p {
  line-height: $line-height-relaxed;
  $baseline-multiplier: 0.179;
  $x-height-multiplier: 0.35;
  margin: $spacing-0 $spacing-0 $spacing-4 $spacing-0;
  padding: $spacing-0;
}

ul,
ol {
  margin-left: $spacing-0;
  margin-right: $spacing-0;
  padding: $spacing-0;
  margin-bottom: $spacing-8;
  list-style-position: inside;
  list-style-image: none;
}

li p {
  display: inline;
}

ul li,
ol li {
  padding-left: $spacing-0;
  margin-bottom: math.div($spacing-8, 2);
}

li > p {
  margin-bottom: math.div($spacing-8, 2);
}

li *:last-child {
  margin-bottom: $spacing-0;
}

li > ul {
  margin-left: $spacing-8;
  margin-top: math.div($spacing-8, 2);
}

blockquote {
  color: $color-theme-4;
  margin-left: calc(#{-1 + $spacing-6});
  margin-right: $spacing-8;
  padding: $spacing-0 $spacing-0 $spacing-0 $spacing-6;
  border-left: $spacing-1 solid $color-primary;
  font-size: $font-size-2;
  font-style: italic;
  margin-bottom: $spacing-8;
}

blockquote > :last-child {
  margin-bottom: $spacing-0;
}

blockquote > ul,
blockquote > ol {
  list-style-position: inside;
}

table {
  width: 100%;
  margin-bottom: $spacing-8;
  border-collapse: collapse;
  border-spacing: 0.25rem;
}

table thead tr th {
  border-bottom: 1px solid $color-accent;
}

/* Link */
a {
  color: $color-theme-4;
}

a,
button {
  // browser will not anticipate double click so proceeds with action quicker (300 ms quicker)
  touch-action: manipulation;
}

h1 > a {
  color: inherit;
  text-decoration: none;
}
h2 > a,
h3 > a,
h4 > a,
h5 > a,
h6 > a {
  text-decoration: none;
  color: inherit;
}

a:hover,
a:focus {
  text-decoration: none;
}

/* Custom classes */
.global-wrapper {
  margin: $spacing-0 auto;
  max-width: $max-width-wrapper;
  padding: $spacing-10 $spacing-5;
}

.global-header {
  margin-bottom: $spacing-12;
}

.post-list-item {
  margin-bottom: $spacing-8;
  margin-top: $spacing-8;
}

.post-list-item p {
  margin-bottom: $spacing-0;
}

.post-list-item h2 {
  font-size: $font-size-4;
  color: $color-primary;
  margin-bottom: $spacing-2;
  margin-top: $spacing-0;
}

.post-list-item header {
  margin-bottom: $spacing-4;
}

.bio {
  display: flex;
  margin-bottom: $spacing-16;
}

.global-wrapper[data-is-root-path='true'] .bio {
  margin-bottom: $spacing-20;
}

.bio p {
  margin-bottom: $spacing-0;
}

.bio-avatar {
  margin-right: $spacing-4;
  margin-bottom: $spacing-0;
  min-width: 50px;
  border-radius: 100%;
}

.blog-post header h1 {
  margin: $spacing-0 $spacing-0 $spacing-4 $spacing-0;
}

.blog-post header p {
  font-size: $font-size-2;
  font-family: $font-heading;
}

.blog-post-nav ul {
  margin: $spacing-0;
}

.gatsby-highlight {
  margin-bottom: $spacing-8;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  width: 1px;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}

figure {
  margin-bottom: $spacing-6;
  padding-bottom: $spacing-6;
}

figure figcaption {
  margin-top: $spacing-2;
}

/* Media queries */
@media (max-width: $desktop-breakpoint) {
  h1 {
    font-size: $mobile-font-size-6;
  }

  h2 {
    font-size: $mobile-font-size-5;
  }

  h3 {
    font-size: $mobile-font-size-4;
  }

  h4 {
    font-size: $mobile-font-size-3;
  }

  h5 {
    font-size: $mobile-font-size-2;
  }

  h6 {
    font-size: $mobile-font-size-1;
  }

  blockquote {
    padding: $spacing-0 $spacing-0 $spacing-0 $spacing-4;
    margin-left: $spacing-0;
  }
  ul,
  ol {
    list-style-position: inside;
  }
}